-
Notifications
You must be signed in to change notification settings - Fork 372
Add cli for @huggingface/hub #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Julien Chaumond <[email protected]>
That way I can run `pnpm link`: https://pnpm.io/cli/link to test #1412
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
btw @Wauplin @hanouticelina do you have advice regarding the cli params? This PR adds
Note that we could be fancy and do like git Edit: is the hub url configurable or not with the python cli? (thinking of adding |
FYI released a test version, can be gotten with or just |
Hey, just some high-level consideration (I haven't reviewed the PR itself). I don't think that the My reasoning is that parameters for branch creation is not really related to the upload itself.
Doesn't exist as a parameter no. Switching Hub url is only useful for dev purposes and in Python at least, it can be done using the |
Sure In that case will use
Ok, can do the same behavior Edit: hfjs create-branch coyotte508/test-model build --empty
hfjs upload coyotte508/test-model --revision build in 03e615d |
Let's see what others think but API looks good to me |
just for viz, also added a
|
lgtm too |
API looks good. A couple of things I saw while testing some of the stuff I do during releases with the Python CLI:
|
Thanks for the feedback @pcuenca !
The plan is to have the same behavior/API as the python CLI for the features that are in both CLI. The python cli seems to automatically creates repos, we can do the same with the same API. Still a bit sketchy to create a repo just like that, what if the user made a typo on an existing repo name 🤔 (but if consensus on adding it it can be added still) The description of the param was updated in last commit, thank you!
Yes there's a bug atm, see this slack: https://huggingface.slack.com/archives/C0379TL2H0E/p1746609551072829 . It'll be fixed indepently of the
Should also be fixed in last commit
Yea, the hub would probably need to send error codes that the cli can translate into custom error messages (like is the case in the python lib for repo not found / file not found errors) |
cc @Wauplin @hanouticelina for viz
Internal context: https://huggingface.slack.com/archives/C0256NXF0A2/p1745930278721439?thread_ts=1741697907.530409&cid=C0256NXF0A2
Also add
createBranch
anddeleteBranch
functionsFollow up to #1398
eg:
Testing
go into
packages/hub
run
pnpm install
and run
sudo npm link
- then you can usehfjs
or just do
node dist/cli.js upload ...